package com.jxwifi.cloud.quickcleanserver.mycenter.model;

/**
 * Created by Administrator on 2020/8/11.
 */

public enum healthState {

    EXPIRED("expired", "已过期"),REVOKED("revoked", "平台吊销"),NORMAL("normal", "正常"),NEAR_EXPIRATION("near_expiration", "即将到期"),WAITING("wait", "待审核"),FAILED("failed", "未通过"),NONE("none", "未上传");

    private String description;
    private String code;

    private healthState(String description, String code) {
        this.description = description;
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    /**
     * 根据code去名称
     *
     * @param code
     * @return
     */
    public static String formCode(String code) {
        for (healthState u : healthState.values()) {
            if (u.getCode().equals(code))
                return u.getDescription();
        }
        return null;
    }
}
